--test10.e

<'

import ../examples/vv_ahblite_config;
import ../e/vv_ahblite_master_seq_lib;

extend M0 MAIN vv_ahblite_master_sequence {
    
    !incr16 : INCR16_RW vv_ahblite_master_sequence;
        
    num : uint;
    keep num in [50..100];
           
    body() @driver.clock is only {
    	
    	var addr: uint (bits:32); 
    	var busy: uint;
    	var write: bit;
    	
    	for i from 1 to num do {
    		   		
    		gen addr keeping {it in [0..65535];};
    		gen busy keeping {it in [0..4];};
    		gen write;
    		
            do incr16 keeping{
            	.start_address == addr;
            	.busy == busy;
            	.write == write;
            };
        
    	};
    }; 

}; 

extend MAIN vv_ahblite_slave_sequence {

    -- The slave sequence driver is a reactive sequence driver.
    -- This sets its default to never runs out of sequence items.
    keep soft count == MAX_UINT;
    
    body() @driver.clock is only {
    	for i from 1 to count {
    		do response keeping {
    	soft	.wait_states_num == select {
			    	80: 0;
			    	5: 1;
			    	5: 2;
			    	10: [4..16];
		 };
    			
    	soft .ready == select {
	    	10: 0; --30% cases add wait states
	    	90: 1; --70% no wait state
	    };
	    
	    soft .response == select {
	    	10: 1; -- error response
	    	90: 0; -- OK response
	    };
		   			
    		}; // do term keeping...
    	}; // for i from 1 to...
    }; // body() @driver....
    
};

'>